//
//  SplashViewController.m
//  Voxper
//
//  Created by Irfan Bashir on 4/24/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "SplashViewController.h"
#import "VoxperAppDelegate.h"
#import "UIManager.h"
#import "Settings.h"
#import "Constants.h"
#import "RegistrationOptionsViewController.h"

@implementation SplashViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        app = [UIApplication sharedApplication].delegate;
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    [[self navigationItem] setTitle:APP_NAME];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)btnContinue_Clicked:(id)sender {
    [app.uiManager.settings setShouldDisplaySplashView:NO];
    RegistrationOptionsViewController *registrationOptionsViewController = [[RegistrationOptionsViewController alloc] initWithNibName:@"RegistrationOptionsViewController" bundle:[NSBundle mainBundle]];
    [[self navigationController] pushViewController:registrationOptionsViewController animated:YES];
    [registrationOptionsViewController release];
}
@end